home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / COMPILER / LCCBIN / !lcc / !Help < prev    next >
Text File  |  1998-06-07  |  5KB  |  117 lines

  1.                              LCC 4.0 for RISC OS
  2.                              ———————————————————
  3.  
  4.                     ported by Reuben Thomas (rrt@sc3d.org)
  5.  
  6.  
  7. Lcc is an ANSI C compiler. It is small and fast, though the code it produces
  8. is currently of poor quality. However, because of its speed (about twice as
  9. fast as GNU C with no optimisation) it is useful for development work, when
  10. you spend far more time compiling than running your programs, and because of
  11. its size it should run on computers that cannot accomodate GNU C (I think it
  12. should be possible to use it without virtual memory on machines with 2Mb
  13. RAM; possibly even 1Mb).
  14.  
  15. Owing to the paucity of the documentation, this is not really a package for
  16. novices, but do feel free to ask me questions about installation and use
  17. (preferably on the comp.sys.acorn.programmer newsgroup, so that others can
  18. benefit from the answers).
  19.  
  20. Stu Smith (s.d.smith@exeter.ac.uk) is working on an improved code generator.
  21. For details see http://www.geocities.com/SiliconValley/Lab/4330/.
  22.  
  23.  
  24. Conditions
  25. ——————————
  26.  
  27. See the files in Docs.Licenses for conditions of use.
  28.  
  29.  
  30. Usage
  31. —————
  32.  
  33. To install lcc, copy the !lcc and !clib applications out of the distribution
  34. archive. They can even be installed on a floppy (a squeeze in 800Kb, more
  35. plausible in 1.6Mb. If you are running RISC OS 3.6 or lower, copy the module
  36. CallASWI into your !System.Modules directory.
  37.  
  38. See the documentation in Docs for how to use lcc and bprint (bprint is used
  39. for profiling).
  40.  
  41. Lcc comes with a modified version of Nick Burrett's CLib, which links with
  42. the Shared C Library. You can also use UnixLib (from
  43. http://www.callan.demon.co.uk/unixlib/); to do so you must pass the -Bunix
  44. switch to lcc (this switch will probably change in future releases).
  45.  
  46. If you want to link with CLib but still have automatic Unix filename
  47. translation, define __UNAME by passing -D__UNAME to lcc. See the file
  48. !FileTrans in !clib for more information.
  49.  
  50. If you are interested in the innards, lcc version 3.x is described in detail
  51. in the book `A Retargetable C Compiler: Design and Implementation'
  52. (Addison-Wesley, 1995, ISBN 0-8053-1670-1). The source distribution is
  53. available from the main ftp site (<address here>).
  54.  
  55.  
  56. Problems and limitations
  57. ————————————————————————
  58.  
  59. Lcc has been tested fairly thoroughly: if used to compile itself, this
  60. version then compiles a version identical to itself; but I expect bugs
  61. remain. Please report them to me, not to lcc's authors. A small (less than 10
  62. lines) program demonstrating the bug would be much appreciated.
  63.  
  64. Lcc is incompatible with Acorn C in two areas: first, it does not widen
  65. float arguments to double before passing them to a function in which they
  66. are declared float, and secondly it does not return some one-word structures
  67. in the same way. In practice this isn't a problem, as neither difference
  68. affects the Shared C Library, but it is something to be careful of when
  69. linking to other libraries or code.
  70.  
  71. The only debugging information provided by the -g flag is function names in
  72. stack backtraces.
  73.  
  74. If you get error messages about "overflow in floating constant 'x'", it might
  75. be because of a bug in gcc which compiles floating-point constants
  76. incorrectly. I have hand-patched this in the assembler source, but if I've
  77. recompiled lcc without doing this by mistake then the bug will have crept
  78. back in. The tell-tale sign is to try compiling a program that just prints
  79. FLT_MAX. This should not cause an overflow message.
  80.  
  81. I've not tested bprint and the profiling flags. I'd appreciate any feedback
  82. on how well they work, if at all. I suspect that all I'm likely to do at the
  83. moment is to add a warning notice rather than fixing them.
  84.  
  85. The file redirection code has some limitations; see !clib.!Help. In
  86. particular, if a file called junk.o is to be created (e.g. by compiling
  87. junk.c), a directory called "o" must already exist in the destination
  88. directory, as it will not be created automatically.
  89.  
  90. Source files must have names of the form "foo.c" or "c.foo", and preferably
  91. be passed to LCC as "foo.c".
  92.  
  93. If you have GCC installed you should delete !lcc.bin.cpp as GCC's cpp works
  94. with lcc but not vice versa.
  95.  
  96.  
  97. Acknowledgments
  98. ———————————————
  99.  
  100. The authors of lcc, David Hanson and Chris Fraser, were most helpful while I
  101. was porting it, explaining difficulties and putting up with questions that
  102. were actually answered in their book. I recommend the book (see above) to
  103. anyone interested in how C compilers really work.
  104.  
  105. Nick Burrett, the maintainer of RISC OS GCC, kindly allowed me to use gcc's
  106. interface to drlink, ld, and his clib stubs library, as well as providing
  107. helpful advice on APCS.
  108.  
  109. Dave Daniels, author of Drlink, kindly allowed me to distribute it with lcc.
  110.  
  111. Darren Salt and Nick Burret, the maintainers of as, kindly allowed me to
  112. distribute it with lcc.
  113.  
  114. Dominic Symes, Tim Tyler and the other authors of Zap continue to provide
  115. the most comfortable programming environment I have yet used on the Acorn or
  116. any other machine.
  117.